package com.cxs.controller;

import com.cxs.model.Book;
import com.cxs.service.CategoryService;
import cxs.utils.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/*
 * @Author:cxs
 * @Date:2021/9/30  22:12
 * @Version 1.0
 * @Motto:放下杂念,只为迎接明天更好的自己
 * */
@RestController
@RequestMapping("/category")
@Api(tags = "书分类处理器")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    @ApiOperation(value = "获取分列列表")
    public Result<Book> list(){
        return Result.OK("Ok",categoryService.list());
    }
}
